/*
 * @Description: 
 * @Date: 2021-10-08 15:02:54
 * @LastEditTime: 2021-11-03 10:34:57
 */
import axios from 'axios';
import config from "./index.js";
const baseUrl = process.env.NODE_ENV === "development" ? config.baseUrl.dev : config.baseUrl.pro;
// 创建axios实例
const service = axios.create({
  baseURL: baseUrl,
  timeout: 200000,
});
// 添加请求拦截器
service.interceptors.request.use(function (config) {
  return config;
}, function (error) {
  return Promise.reject(error);
});

// 添加响应拦截器
service.interceptors.response.use(function (response) {
  return response.data;
}, function (error) {
  return Promise.reject(error);
});
export default service;